<?php

namespace App\Admin\Extensions\Table;

use App\Models\AgentUser;
use Dcat\Admin\Grid;
use Dcat\Admin\Grid\LazyRenderable;

class AgentUserSelectTable extends LazyRenderable
{
    public function grid(): Grid
    {

        return Grid::make(new AgentUser(), function (Grid $grid) {
            $grid->disableCreateButton();
            $grid->disableBatchActions();
            $grid->disableActions();
            $grid->model()->orderByDesc("id");
            $grid->disableViewButton();
            $grid->disableQuickEditButton();
            $grid->column('id')->sortable();
            $grid->column('name','代理商名称');
            $grid->column('created_at');
            $grid->quickSearch(['id','name']);
            $grid->paginate(8);
        });
    }


}
